package com.mindmax.user.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 亿图权限点对象 yt_resource
 *
 * @author 胡瑞鹏
 * @date 2024-04-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Resource extends TreeEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 权限点名称 */
    @Excel(name = "菜单名称")
    private String resourceName;

    @Excel(name = "菜单英文名称")
    private String resourceEnName;

    @Excel(name = "组件路径")
    private String component;

    @Excel(name = "重定向")
    private String redirect;


    @Excel(name = "路由关键字")
    private String keyName;

    /** 权限点类型，1目录，2菜单，3按钮 */
    @Excel(name = "类型，1目录，2菜单，3按钮")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long resourceType;

    /** 权限点编码 */
    @Excel(name = "权限点编码")
    private String resourceCode;

    /** 创建者id */
    @Excel(name = "创建者id")
    private Long createUser;

    /** 更新人id */
    @Excel(name = "更新人id")
    private Long updateUser;

    /** 删除标记 */
    @Excel(name = "删除标记")
    private Long deleted;

    /** 请求地址 */
    @Excel(name = "请求地址")
    private String url;

    /** 打开方式（item页签，blank新窗口） */
    @Excel(name = "打开方式", readConverterExp = "item页签，blank新窗口")
    private String target;

    /** 菜单状态，（0显示，1隐藏） */
    @Excel(name = "菜单状态，", readConverterExp = "0=显示，1隐藏")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long visible;

    /** 是否刷新(0刷新，1不刷新) */
    @Excel(name = "是否刷新(0刷新，1不刷新)")
    private Long isRefresh;

    /** 图标地址 */
    @Excel(name = "图标地址")
    private String icon;


    private List<Resource> children = new ArrayList<Resource>();





    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setResourceName(String resourceName)
    {
        this.resourceName = resourceName;
    }

    public String getResourceName()
    {
        return resourceName;
    }
    public void setResourceType(Long resourceType)
    {
        this.resourceType = resourceType;
    }

    public Long getResourceType()
    {
        return resourceType;
    }
    public void setResourceCode(String resourceCode)
    {
        this.resourceCode = resourceCode;
    }

    public String getResourceCode()
    {
        return resourceCode;
    }
    public void setCreateUser(Long createUser)
    {
        this.createUser = createUser;
    }

    public Long getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(Long updateUser)
    {
        this.updateUser = updateUser;
    }

    public Long getUpdateUser()
    {
        return updateUser;
    }
    public void setDeleted(Long deleted)
    {
        this.deleted = deleted;
    }

    public Long getDeleted()
    {
        return deleted;
    }
    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getUrl()
    {
        return url;
    }
    public void setTarget(String target)
    {
        this.target = target;
    }

    public String getTarget()
    {
        return target;
    }
    public void setVisible(Long visible)
    {
        this.visible = visible;
    }

    public Long getVisible()
    {
        return visible;
    }
    public void setIsRefresh(Long isRefresh)
    {
        this.isRefresh = isRefresh;
    }

    public Long getIsRefresh()
    {
        return isRefresh;
    }
    public void setIcon(String icon)
    {
        this.icon = icon;
    }

    public String getIcon()
    {
        return icon;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("parentId", getParentId())
            .append("resourceName", getResourceName())
            .append("resourceType", getResourceType())
            .append("resourceCode", getResourceCode())
            .append("createUser", getCreateUser())
            .append("updateUser", getUpdateUser())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deleted", getDeleted())
            .append("orderNum", getOrderNum())
            .append("url", getUrl())
            .append("target", getTarget())
            .append("visible", getVisible())
            .append("isRefresh", getIsRefresh())
            .append("icon", getIcon())
            .append("remark", getRemark())
            .toString();
    }

    public List<Resource> getChildren() {
        return children;
    }

    public void setChildren(List<?> children)
    {
        this.children = (List<Resource>) children;
    }

}
